<?php
$this->breadcrumbs=array(
	'List',
);?>

	
<?php echo $this->alquiler;?>
<div class="form">
<?php echo CHtml::beginForm(); ?>

	<fieldset>
    	<legend>Seleccione los par&aacute;metros de b&uacute;squeda</legend>
    	<table id="tbl_oper">
			<tr>
				<td>
					Alquiler
					<input type="radio" name="oper" id="rad_alquiler" <?php if ($this->oper == '2') echo 'checked';?> value="2">
				</td>
				<td>
					Venta
					<input type="radio" name="oper" id="rad_venta" <?php if ($this->oper == '1') echo 'checked';?> value="1">
				</td>
				<td>
					Remate
					<input type="radio" name="oper" id="rad_remate" <?php if ($this->oper == '3') echo 'checked';?> value="3">
				</td>
			</tr>
		</table>
		
	

 
 		<table id="tbl_zonaTipo">
	 		<tr>
 				<td>
	 				<div class="row">
        				<?php echo CHtml::label('Tipo de Propiedad', 'cmb_Tipo') ?>
        			
        				<?php
        				$optTipo = Array(); 
    	    			$tipos = TipoPropiedad::model()->findAll();
	        			foreach ($tipos as $tipo){
        					$optTipo[$tipo->id]=$tipo->nombre;
        				}
        				echo CHtml::dropDownList('cmb_Tipo', $this->tipoProp , $optTipo, array('empty'=>'Elegir Tipo')); 
       					?>
    				</div>
	 			</td>
 				<td>
 					<div class="row">
 						<?php echo CHtml::label('Zona', 'cmb_Zona') ?>
	 					<?php
        				$optZona = Array(); 
        				$zonas = Zona::model()->findAll();
        				foreach ($zonas as $zona){
    	    				$optZona[$zona->id]=$zona->nombre;
	        			}
        				echo CHtml::dropDownList('cmb_Zona', $this->zonaProp , $optZona, array('empty'=>'Elegir Zona')); 
       					?>
 					</div>
 				</td>
 				<td>
 					<div class="row">
 						<?php echo CHtml::label('Ordenar por precio', 'cmb_Precio') ?>
	 					<?php
	 						if($this->prices == 'DESC'){
	 							echo CHtml::dropDownList('cmb_Precio', $this->zonaProp , array('ASC'=>'Menor a Mayor', 'DESC' =>'Mayor a Menor'), array('options'=>array('DESC'=>array('selected'=>'selected'))));
	 						}else{
        						echo CHtml::dropDownList('cmb_Precio', $this->zonaProp , array('ASC'=>'Menor a Mayor', 'DESC' =>'Mayor a Menor'), array('options'=>array('ASC'=>array('selected'=>'selected')))); 
	 						}
       					?>
 					</div>
 				</td>
 		</table>
 		<div class="row submit">
        <?php echo CHtml::submitButton('Filtrar'); ?>
    	</div>
 	</fieldset>
       
 
    
 
<?php echo CHtml::endForm(); ?>
</div><!-- form -->

<?php $this->widget('zii.widgets.CListView', array(
	'dataProvider'=>$dataProvider,
	'itemView'=>'_view',
	'template'=>"{items}\n{pager}",
)); ?>
